package com.lire.shop.service.impl;

import com.lire.shop.dao.ChecklistRepository;
import com.lire.shop.entity.Checklist;
import com.lire.shop.service.ChecklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.Instant;

@Service
public class ChecklistServiceImpl implements ChecklistService {

    @Autowired
    private ChecklistRepository checklistRepository;

    @Override
    public void insertByOid(Long oid,Integer mode,String balances) {
        Checklist checklist = new Checklist();
        checklist.setOid(oid);
        checklist.setShiftMode(mode);
        checklist.setCreateTime(Instant.now().toEpochMilli());
        checklist.setCurrentBalances(balances);
        checklistRepository.save(checklist);
    }
}
